<%@ page import="com.ContasCorrente"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'contasCorrente.label', default: 'ContasCorrente')}" />
<title><g:message code="default.create.label"
		args="[entityName]" /></title>
<script>

	function conciliar(){
		var contaCorrente = jQuery('#contaCorrente').val();
		var dataInicial_day = jQuery('#dataInicial_day').val();
		var dataInicial_month = jQuery('#dataInicial_month').val();
		var dataInicial_year = jQuery('#dataInicial_year').val();
		var dataInicial = dataInicial_day + "/" + dataInicial_month + "/" + dataInicial_year;  
		console.log("data " + dataInicial);
		jQuery
				.ajax({
					type : "POST",
					url : "/CashFinancas/contasCorrente/getContas",
 					data : {
						'dataInicial' : dataInicial,
						'contaCorrente' : contaCorrente
					},
					success : function(result) {
						var teste = null
						var obj = ""
						teste = "<tr>"
					
					result.each {
							obj = result[i] 
							console.log(obj.contaId)
								
						}
						
						//$j('#default').after(teste);
						//$j('#dinamicTbody').show(5000);
						// jQuery('#informacaoAdicionalId').append(options)
					},
					error : function(error) {
						alert("erro ao buscar ações." + error)
					}

				});	
}
</script>
</head>
<body>
	<div class="nav">
		<span class="menuButton"><a class="home"
			href="${createLink(uri: '/')}"><g:message
					code="default.home.label" /> </a> </span>
	</div>
	<h1 id="pageName">Concilia&ccedil;&atilde;o Bancaria</h1>

	<g:if test="${flash.message}">
		<div class="message">
			${flash.message}
		</div>
	</g:if>
	<g:hasErrors bean="${contasCorrenteInstance}">
		<div class="errors">
			<g:renderErrors bean="${contasCorrenteInstance}" as="list" />
		</div>
	</g:hasErrors>
<style>
.links-solicitacoes {
	padding: .5em;
	background-color: white;
}

.links-solicitacoes a {
	padding: 1em;
	display: block;
	width: 30%;
	float: left;
	border: 1px solid transparent;
}

.links-solicitacoes a:hover {
	background-color: #444;
	color: white;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
}
.links-solicitacoes a:active {
	background-color: #000;
	color: white;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
}
</style>
	<g:form action="save" method="post">
		<div class="links-solicitacoes">
			<g:each in="${contasCorrenteList}" status="i" var="contaCorrente">
				<a href="conciliaContas?contaCorrente.id=${contaCorrente.id}"
					class="link-solicitacao" title="Conciliar Conta Bancaria">
					${contaCorrente}
				</a>
			</g:each>
			<div style="clear: both;"></div>
		</div>
	</g:form>

</body>
</html>
